<template>
  <div class="max-button-box-div">

    <!-- 商品分类按钮 -->
    <span class="title-font-span">商品管理</span>


    <span @click="showGoodsAddFrom" class="green-add-btn">
      <i class="fa fa-plus-square-o" aria-hidden="true"></i>
    </span>
    <span class="btn-name-font">商品添加</span>

    <span @click="showGoodsCategory" class="yellow-class-btn">
      <i class="fa fa-tasks" aria-hidden="true"></i>
    </span>
    <span class="btn-name-font">分类管理</span>

    <span v-if="isTable < 3" @click="changeGoodsLookStyle" class="yellow-eye-btn">
      <i class="fa fa-eye"></i>
    </span>
    <span v-if="isTable < 3" class="btn-see-font">切换查看</span>

    <span v-if="isTable > 2" @click="changeGoodsLookStyle" class="zs-eye-btn">
      <i class="fa fa-eye"></i>
    </span>
    <span v-if="isTable > 2" class="btn-see-font">商品列表</span>

  </div>
</template>

<script>
module.exports = {
  data() {
    return {
      isTable: 2,
    }
  },
  methods: {
    changeGoodsLookStyle() {
      if (this.isTable == 2) {
        this.isTable = 1;
      } else {
        this.isTable = 2;
      }
      this.$emit("sendgoodslookstyle", this.isTable);
    },
    showGoodsCategory() {
      this.isTable = 3;
      this.$emit("show-goods-category", 3);
    },
    showGoodsAddFrom() {
      this.$emit("show-goods-add-from", 4);
    }
  }
}
</script>

<style scoped>
.max-button-box-div {
  height: 75px;
  width: 1265px;
}

.btn-name-font {
  font-size: 19px;
  margin: 0px;
  line-height: 24px;
  margin-right: 30px;
  text-align: -webkit-left;
}

.title-font-span {
  display: inline-block;
  width: 147px;
  height: 38px;
  margin-right: 30px;
  font-size: 26px;
  border-right: 2px solid rgba(0, 0, 0, 0.24);
  text-align: inherit;
}

.yellow-class-btn {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  font-family: 'Source Sans Pro', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  border-collapse: collapse;
  border-spacing: 0;
  box-sizing: border-box;
  text-decoration: none;
  display: inline-block;
  margin-bottom: 0;
  font-weight: 400;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
  touch-action: manipulation;
  cursor: pointer;
  background-image: none;
  user-select: none;
  color: #fff;
  padding: 1px 5px;
  font-size: 12px;
  line-height: 1.5;
  border-radius: 3px;
  box-shadow: none;
  border: 1px solid transparent;
  background-color: rgb(243 156 18 / 79%);
  font-size: 40px;
  height: 42px;
  width: 53px;
}

.green-add-btn {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  font-family: 'Source Sans Pro', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  border-collapse: collapse;
  border-spacing: 0;
  box-sizing: border-box;
  text-decoration: none;
  display: inline-block;
  margin-bottom: 0;
  font-weight: 400;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
  touch-action: manipulation;
  cursor: pointer;
  background-image: none;
  user-select: none;
  color: #fff;
  padding: 1px 5px;
  font-size: 12px;
  line-height: 1.5;
  border-radius: 3px;
  box-shadow: none;
  border: 1px solid transparent;
  background-color: rgb(0 166 90 / 78%);
  border-color: #00368d;
  font-size: 42px;
  height: 42px;
  width: 53px;
}

.yellow-eye-btn {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  font-family: 'Source Sans Pro', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  border-collapse: collapse;
  border-spacing: 0;
  box-sizing: border-box;
  text-decoration: none;
  display: inline-block;
  margin-bottom: 0;
  font-weight: 400;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
  touch-action: manipulation;
  cursor: pointer;
  background-image: none;
  user-select: none;
  color: #fff;
  padding: 1px 5px;
  font-size: 12px;
  line-height: 1.5;
  border-radius: 3px;
  box-shadow: none;
  border: 1px solid transparent;
  background-color: rgb(243 156 18 / 79%);
  font-size: 40px;
  height: 42px;
  width: 53px;
  margin-left: 595px;
}

.zs-eye-btn {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  font-family: 'Source Sans Pro', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  border-collapse: collapse;
  border-spacing: 0;
  box-sizing: border-box;
  text-decoration: none;
  display: inline-block;
  margin-bottom: 0;
  font-weight: 400;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
  touch-action: manipulation;
  cursor: pointer;
  background-image: none;
  user-select: none;
  color: #fff;
  padding: 1px 5px;
  font-size: 12px;
  line-height: 1.5;
  border-radius: 3px;
  box-shadow: none;
  border: 1px solid transparent;
  background-color: #41aef3;
  font-size: 40px;
  height: 42px;
  width: 53px;
  margin-left: 595px;
}

.btn-see-font {
  font-size: 19px;
  line-height: 24px;
  text-align: -webkit-left;
}
</style>